import Vue from "vue";
import Router from "vue-router";
import Home from "./views/Home.vue";
import Register from './views/Register'
import Login from './views/Login'
import MaIndex from './views/manager/Index'
import MaLogin from './views/manager/Login'
import Category from './views/manager/Category'
import Test from './Test'
import Product from './views/manager/Product'
import Index from './views/Index'
import Products from './views/Products'
import ProductInfo from './views/ProductInfo'
import ShopCart from './views/ShopCart'
import Settlement from './views/Settlement'
import Order from './views/Order'
import MaOrder from './views/manager/Order'
import User from './views/User'
import UserInfo from './views/userInfo/UserInfo'
import UpdateUser from './views/userInfo/UpdateUser'
import UserAddress from './views/userInfo/UserAddress'
import UpdatePwd from './views/userInfo/UpdatePwd'

Vue.use(Router);

export default new Router({
  routes: [
    {
      path: "/",
      name: "home",
      component: Home,
      meta: {
        title: "首页"
      },
      children: [
        {
          path: "/",
          name: "index",
          component: Index,
          meta: {
            title: "首页"
          }
        },
        {
          path: "/productInfo",
          name: "productInfo",
          component: ProductInfo,
          meta: {
            title: "商品详情"
          }
        },
        {
          path: "/products",
          name: "products",
          component: Products,
          meta: {
            title: "搜索"
          }
        },
        {
          path: "/ShopCart",
          name: "ShopCart",
          component: ShopCart,
          meta: {
            title: "购物车"
          }
        },
        {
          path: "/Settlement",
          name: "Settlement",
          component: Settlement,
          meta: {
            title: "结算页"
          }
        },
        {
          path: "/Order",
          name: "Order",
          component: Order,
          meta: {
            title: "我的订单"
          }
        },
        {
          path: "/User",
          name: "User",
          component: User,
          meta: {
            title: "用户信息"
          },
          children: [
            {
              path: "/UserInfo",
              name: "UserInfo",
              component: UserInfo,
              meta: {
                title: "基本信息"
              }
            },
            {
              path: "/UpdateUser",
              name: "UpdateUser",
              component: UpdateUser,
              meta: {
                title: "修改信息"
              }
            },
            {
              path: "/UserAddress",
              name: "UserAddress",
              component: UserAddress,
              meta: {
                title: "地址管理"
              }
            },
            {
              path: "/UpdatePwd",
              name: "UpdatePwd",
              component: UpdatePwd,
              meta: {
                title: "密码修改"
              }
            }
          ]
        }
      ]
    },
    {
      path: "/test",
      name: "test",
      component: Test,
      meta: {
        title: "测试"
      }
    },
    {
      path: "/register",
      name: "register",
      component: Register,
      meta: {
        title: "注册"
      }
    },
    {
      path: "/login",
      name: "login",
      component: Login,
      meta: {
        title: "登录"
      }
    },
    {
      path: "/maIndex",
      name: "maIndex",
      component: MaIndex,
      meta: {
        title: "后台管理"
      },
      children: [
        {
          path: "/Category",
          name: "Category",
          component: Category,
          meta: {
            title: "类别管理"
          }
        },
        {
          path: "/Product",
          name: "Product",
          component: Product,
          meta: {
            title: "商品管理"
          }
        },
        {
          path: "/maOrder",
          name: "maOrder",
          component: MaOrder,
          meta: {
            title: "订单管理"
          }
        }
      ]
    },
    {
      path: "/MaLogin",
      name: "MaLogin",
      component: MaLogin,
      meta: {
        title: "后台登录"
      }
    }
  ]
});
